<template>
<div class="">
    <h1 v-for="item,index in arr" :key="index">
        索引index:{{ index }}的值是:{{ item }}
        第{{ index+1 }}个是:{{ item }}
    </h1>
    <hr/>
    <h1 v-for="item,key,index in obj">
        obj的index：{{ index+1 }}的key是:{{ key }} 的值是:{{ item }}
    </h1>
</div>
</template>

<script setup>
import { reactive,ref } from 'vue';
const arr = reactive(['one','two','three'])
const obj = reactive({
    name:'张三',
    age:11,
    sex:1
})
</script>

<style scoped></style>